package com.company.project.demo.service.common.impl;

import com.base.common.model.dto.BaseDto;
import com.company.project.demo.manager.common.HealthManager;
import com.company.project.demo.service.common.HealthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description 健康检查service
 * @Author zhongbo.yu
 * @Date 2021/12/28
 */
@Service
public class HealthServiceImpl implements HealthService {

    @Autowired
    private HealthManager healthManager;

    @Override
    public BaseDto check() {
        Boolean res = healthManager.check();
        if (res) {
            return BaseDto.buildSuccess();
        } else {
            return BaseDto.buildFailure();
        }
    }
}
